---@class InAttackRangeCondition :AbstractCondition
local InAttackRangeCondition = ClientFight.CreateClass("InAttackRangeCondition",ClientFight.AbstractCondition)
function InAttackRangeCondition:update()
    --无法选择技能
    local prepareSkill = self.fighter.prepareSkill
    if prepareSkill == nil then
        return EStatus.FAILURE
    end
   SkillRoleMgr.savePathFile( "[" .. self.fight.frame .. "][距离判断]" .. self.fighter:print() .. "进行距离判断");
    local inAttackRange = false
    local prepareTarget = self.fighter.prepareTarget
    if prepareSkill:getAttackShape() ~= nil then
        inAttackRange = DistanceUtil.overlap(self.fighter.position, AttackUtils.getAttackShape(self.fighter, prepareSkill),
                prepareTarget.position, prepareTarget.shape)
    else
        inAttackRange = DistanceUtil.overlap(self.fighter.position, AttackUtils.getAttackRadius(self.fighter, prepareSkill), prepareTarget.position)
        --吸引普攻子弹，忽略攻击距离
        if prepareSkill.skillBean.f_SkillType == 1 and prepareSkill.skillBean.f_GeneralAttackType == 1 then
            if (FighterStateEnum.is(prepareTarget, FighterStateEnum.ATTRACT_NORMAL_BULLET)) then
                inAttackRange = true;
            end
        end
    end
    if not inAttackRange then
       SkillRoleMgr.savePathFile( "[" .. self.fight.frame .. "][距离判断]失败, " .. self.fighter:print() .. "的目标" .. prepareTarget:print() .. "不在技能" .. prepareSkill.skillBean.f_SkillID .. "的攻击距离范围内");
        return EStatus.FAILURE;
    end
   SkillRoleMgr.savePathFile( "[" .. self.fight.frame .. "][距离判断]成功, " .. self.fighter:print() .. "的目标" .. prepareTarget:print() .. "在技能" .. prepareSkill.skillBean.f_SkillID .. "的攻击距离范围内");

    return EStatus.SUCCESS;
end